package cc.kzc.adminauth.config;

import javax.servlet.Filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SvrCharsetConfig {

	@Bean
	public FilterRegistrationBean<Filter> charsetFilter() {
		FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
		// 注入过滤器
		registration.setFilter(new SvrCharsetFilter());
		// 拦截规则
		registration.addUrlPatterns("/*");
		// 过滤器名称
		registration.setName("svrCharsetFilter");
		// 指定优先级
		registration.setOrder(1);

		return registration;
	}

}
